home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_359 / dice / dice.lzh / doc / dc1.doc < prev    next >
Text File  |  1990-05-19  |  2KB  |  59 lines

  1.  
  2.                 DC1.DOC
  3.  
  4.                 MAIN COMPILER PASS
  5.  
  6.     DC1 cppd_src_file [-o outfile] <options>
  7.  
  8.     (NOTE: Refer to DCC.DOC for front end options)
  9.  
  10.     DC1 is the compiler itself.  As input it requires an already
  11.     preprocessed file and as output it produces assembly.  Many assemblers
  12.     will not be able to assemble the output due to forward referenced REG
  13.     labels and the PROCSTART, PROCEND directives.  The output is normally
  14.     fed to DAS, which handles a subset of 68000 and also does certain
  15.     optimizations (see the document on DAS)
  16.  
  17.     The compiler generates absolute data references and relative code
  18.     references by default.  Do not confuse this with DCC's default, which
  19.     is small-data and small-code.
  20.  
  21.     The compiler will put argument and auto variables into registers
  22.     according to register availability and usage.  It will use A0-A1/D0-D1
  23.     for register variables whenever possible.  Consequently, the most
  24.     heavily used variables will be in registers even for very large
  25.     subroutines.
  26.  
  27.     You should get into the habit of using auto declarations within sub
  28.     blocks rather than declare all your autos at the top of the procedure.
  29.     Apart from making the code more modular, this will enable the compiler
  30.     to make better decisions when allocating register variables.
  31.  
  32.     The output of the compiler generates code of the same order as Aztec or
  33.     Lattice C and, in many cases, makes better choices for register
  34.     variables.    DCC makes much better use of address registers than either
  35.     Aztec or Lattice.  However, it does not do any major contents tracking
  36.     and redundant instructions will be generated.  DAS will handle properly
  37.     optimizing branches and DAS will eventually have a peephole optimizer
  38.     built in it to handle other obvious redundancies.
  39.  
  40.     The compiler does other optimizations itself, such as using bit
  41.     instructions to handle special cases of &, |, and ^, include using
  42.     BTST.
  43.  
  44.             -----------------------
  45.  
  46.  
  47.             -----------------------
  48.  
  49.     VOLATILE and REGISTER type specifiers are currently ignored.  Taking
  50.     the address of any auto variable forces it to be really auto and not
  51.     register.  Since no major optimization is done, volatileness is
  52.     pretty much preserved.  The CONST data type is pretty much ignored as
  53.     well.
  54.  
  55.     There is an 'interrupt' keyword which preserves all registers and returns
  56.     with an RTI instead of an RTS.  This is NOT compatible with Amiga
  57.     interrupts.
  58.  
  59.